import { d as defineComponent, i as createBlock, j as openBlock, ae as Transition, m as withCtx, H as createElementBlock, n as createVNode, af as createCommentVNode, aV as __unplugin_components_4, aA as Fragment, aB as renderList, c9 as __unplugin_components_2, k as unref, J as createBaseVNode, a5 as __unplugin_components_1, ai as __unplugin_components_0$1, a7 as createTextVNode, a8 as toDisplayString, ar as __unplugin_components_3, a6 as Button, aj as __unplugin_components_11, b4 as __unplugin_components_5, K as _export_sfc } from "./stores.js";
import { u as useRouter, h as __unplugin_components_2$1 } from "./index.js";
const _hoisted_1 = {
  key: 0,
  class: "artist-list"
};
const _hoisted_2 = { class: "artist-item" };
const _hoisted_3 = { class: "cover" };
const _hoisted_4 = { class: "cover-data" };
const _hoisted_5 = {
  key: 0,
  class: "num"
};
const _hoisted_6 = {
  key: 1,
  class: "artist-list"
};
const _hoisted_7 = { class: "artist-item" };
const _hoisted_8 = { class: "cover" };
const _hoisted_9 = { class: "cover-data" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ArtistList",
  props: {
    data: {},
    type: {},
    cols: { default: "4 600:4 800:5 900:6 1200:7 1400:8" },
    loadMore: { type: Boolean },
    loading: { type: Boolean },
    loadingText: {}
  },
  emits: ["loadMore"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const router = useRouter();
    return (_ctx, _cache) => {
      const _component_s_image = __unplugin_components_2$1;
      const _component_SvgIcon = __unplugin_components_1;
      const _component_n_text = __unplugin_components_0$1;
      const _component_n_gi = __unplugin_components_2;
      const _component_n_grid = __unplugin_components_4;
      const _component_n_button = Button;
      const _component_n_flex = __unplugin_components_3;
      const _component_n_skeleton = __unplugin_components_11;
      const _component_n_empty = __unplugin_components_5;
      return openBlock(), createBlock(Transition, {
        name: "fade",
        mode: "out-in"
      }, {
        default: withCtx(() => [
          _ctx.data.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
            createVNode(_component_n_grid, {
              cols: _ctx.cols,
              "x-gap": "20",
              "y-gap": "20"
            }, {
              default: withCtx(() => [
                (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (item, index) => {
                  return openBlock(), createBlock(_component_n_gi, {
                    key: index,
                    onClick: ($event) => unref(router).push({
                      name: "artist",
                      query: { id: item.id }
                    })
                  }, {
                    default: withCtx(() => [
                      createBaseVNode("div", _hoisted_2, [
                        createBaseVNode("div", _hoisted_3, [
                          createVNode(_component_s_image, {
                            src: item.coverSize?.m || item.cover,
                            "default-src": "/images/artist.jpg?assest",
                            class: "cover-img"
                          }, null, 8, ["src"]),
                          createVNode(_component_s_image, {
                            src: item.coverSize?.m || item.cover,
                            "default-src": "/images/artist.jpg?assest",
                            class: "cover-shadow"
                          }, null, 8, ["src"]),
                          createVNode(_component_SvgIcon, { name: "Artist" })
                        ]),
                        createBaseVNode("div", _hoisted_4, [
                          createVNode(_component_n_text, { class: "name text-hidden" }, {
                            default: withCtx(() => [
                              createTextVNode(toDisplayString(item.name), 1)
                            ]),
                            _: 2
                          }, 1024),
                          item.musicSize ? (openBlock(), createElementBlock("div", _hoisted_5, [
                            createVNode(_component_SvgIcon, {
                              name: "Music",
                              depth: 3
                            }),
                            createVNode(_component_n_text, {
                              class: "num",
                              depth: 3
                            }, {
                              default: withCtx(() => [
                                createTextVNode(toDisplayString(item.musicSize), 1)
                              ]),
                              _: 2
                            }, 1024)
                          ])) : createCommentVNode("", true)
                        ])
                      ])
                    ]),
                    _: 2
                  }, 1032, ["onClick"]);
                }), 128))
              ]),
              _: 1
            }, 8, ["cols"]),
            _ctx.loadMore ? (openBlock(), createBlock(_component_n_flex, {
              key: 0,
              class: "load-more",
              justify: "center"
            }, {
              default: withCtx(() => [
                createVNode(_component_n_button, {
                  loading: _ctx.loading,
                  size: "large",
                  strong: "",
                  secondary: "",
                  round: "",
                  onClick: _cache[0] || (_cache[0] = ($event) => emit("loadMore"))
                }, {
                  default: withCtx(() => _cache[1] || (_cache[1] = [
                    createTextVNode(" 加载更多 ")
                  ])),
                  _: 1
                }, 8, ["loading"])
              ]),
              _: 1
            })) : createCommentVNode("", true)
          ])) : _ctx.loading ? (openBlock(), createElementBlock("div", _hoisted_6, [
            createVNode(_component_n_grid, {
              cols: _ctx.cols,
              "x-gap": "20",
              "y-gap": "20"
            }, {
              default: withCtx(() => [
                (openBlock(), createElementBlock(Fragment, null, renderList(50, (item) => {
                  return createVNode(_component_n_gi, { key: item }, {
                    default: withCtx(() => [
                      createBaseVNode("div", _hoisted_7, [
                        createBaseVNode("div", _hoisted_8, [
                          createVNode(_component_n_skeleton, { class: "cover-img" })
                        ]),
                        createBaseVNode("div", _hoisted_9, [
                          createVNode(_component_n_skeleton, {
                            text: "",
                            round: "",
                            repeat: 2
                          })
                        ])
                      ])
                    ]),
                    _: 2
                  }, 1024);
                }), 64))
              ]),
              _: 1
            }, 8, ["cols"])
          ])) : (openBlock(), createBlock(_component_n_empty, {
            key: 2,
            description: "空空如也，怎么什么都没有啊",
            size: "large"
          }))
        ]),
        _: 1
      });
    };
  }
});
const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e74af9dd"]]);
export {
  __unplugin_components_0 as _
};
